<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/page/share/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>添加部门</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<meta http-equiv="pragma" content="no-cache" />
		<meta http-equiv="cache-control" content="no-cache" />
		<link rel="stylesheet" href="/css/modules.css" type="text/css"
			media="screen" />
		<link rel="stylesheet" href="/css/modules1.css" type="text/css"
			media="screen" />
		<script type="text/javascript" src="/js/FoshanRen.js"></script>
		<script type="text/javascript" src="/js/xmlhttp.js"></script>
		<script type="text/javascript">
function validateUsernameExsit(name){
	if(username.trim()!=""){
		var usernameview = document.getElementById('usernameview');		
		if(usernameview){
			send_request(function(value){usernameview.innerHTML=value;},
					 '<s:url action="DepartmentManage!exist"/>?name='+ name, true);
		}
	}
}

function Formfield(name, label){
	this.name=name;
	this.label=label;
}
function checkfm(form){
	var list  = new Array(new Formfield("name", "部门名称");
	for(var i=0;i<list.length;i++){
		var objfield = eval("form."+ list[i].name);
		if(trim(objfield.value)==""){
			alert(list[i].label+ "不能为空");
			if(objfield.type!="hidden" && objfield.focus()) objfield.focus();
			return false;
		}
	}
	
	return true;
}
</script>
	</head>
	<body style="background-color: transparent">
		<h2 class="jquery_tab_title">
			部门列表
		</h2>
		<div style="padding-top:20px;padding-left:50px;">
		<s:form action="DepartmentManage!addDepartment" method="post" onsubmit="return checkfm(this)" theme="simple">
			<p>
				<label>部门名称:</label><br />
				<s:textfield name="name" cssClass="input-small" onblur="javascript:validateUsernameExsit(this.value)" /><span id="usernameview"></span><br />
				
			</p>
			<p>
				<input type="submit" name="SYS_SET" value=" 确 定 添 加 " class="button" />
			</p>
		</s:form>
		</div>
	</body>
</html>